import React,{Component} from 'react'

export default class Demo08_ref_children extends Component {
  constructor(props){
    super(props);
    this.name='Demo08_ref_children'
  }
  onchage(){
    console.log(this.refs.myinput.value);
    let message = this.refs.myinput.value;
    //吧 input的值传递给父组件  通过props
    this.props.save(message);
  }
  render(){
    return (
        <input onChange={this.onchage.bind(this)} ref='myinput' type='text' placeholder="请输入"/>
    )
  }

}